package com.lcf.system.controller;

import com.lcf.system.dto.user.SysUserEditDTO;
import com.lcf.system.service.SysUserService;
import com.lcf.system.vo.user.SysUserVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 用户表(User)表控制层
 *
 * @author lcf
 * @since 2025-02-19 13:27:49
 */
@Tag(name = "用户")
@RestController
@RequestMapping("user")
public class SysUserController {
    @Resource
    private SysUserService userService;

    /**
     * 修改我的信息
     */
    @Operation(summary = "修改我的信息")
    @PostMapping
    public void edit(@Validated @RequestBody SysUserEditDTO dto) {
        userService.edit(dto);
    }

    /**
     * 获取我的信息
     */
    @Operation(summary = "获取我的信息")
    @GetMapping
    public SysUserVO getMyInfo() {
        return userService.getMyInfo();
    }
}

